#!/usr/bin/ksh

# Script name: submenu.ksh

main_prompt="What would you like to order? "
dessert_menu="Enter number for dessert choice: "
PS3=$main_prompt	# first set PS3 to be the main prompt

select order in "broasted chicken" "prime rib" "stuffed lobster" dessert "Order Completed"
do
	case $order in
	"broasted chicken")
		print 'Broasted chicken with baked potato,rolls, and salad is $14.95.'
		;;
	"prime rib")
		print 'Prime rib with baked potato, rolls, and fresh vegetable is $17.95.'
		;;
	"stuffed lobster")
		print 'Stuffed lobster with rice pilaf, rolls, and salad is $15.95.'
		;;
	dessert)
		PS3=$dessert_menu	# switch the PS3 to the dessert prompt
		select dessert in "apple pie" "sherbet" "fudge cake" "carrot cake"
		do
			case $dessert in
			"apple pie") 
				print 'Fresh baked apple pie is $2.95.'
				break
				;;
			"sherbet")
				print 'Orange sherbet is $1.25.'
				break
				;;
			"fudge cake")
				print 'Triple layer fudge cake is $3.95.'
				break
				;;
			"carrot cake")
				print 'Carrot cake is $2.95.'
				break
				;;
			*)
				print 'Not a dessert choice.'
			esac	
		done
		PS3=$main_prompt	# re-assign the PS3 to the main prompt
		;;
	"Order Completed")
		break
		;;
	*)
		print 'Not a main entry choice.'
		;;
	esac	
done
#print 'Enjoy your meal.'

	
